﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BHXH.Frm.FrmUserControl;

namespace BHXH.Frm.Frm
{
    public partial class ThuBHXH : UserControl
    {
        Thubhxh_DanhSach usercontrol_ds;
        A01a_TS usercontrol_A01ATS;
        A01_TS usercontrol_A01TS;
        D02_TS usercontrol_D02TS;
        D01b_TS usercontrol_D01bTS;
        D02b_TS usercontrol_D02bTS;
        BBTT_BHYT usercontrol_BHTT_BHYT;
        D07_TS usercontrol_D07TS;
        Dinh_Kem usercontrol_DinhKem;

        public ThuBHXH()
        {
            InitializeComponent();

            usercontrol_ds = new Thubhxh_DanhSach();
            showControl_TabPage_Danhsach(usercontrol_ds);

            usercontrol_A01ATS = new A01a_TS();
            showControl_TabPage_A01aTS(usercontrol_A01ATS);

            usercontrol_A01TS = new A01_TS();
            showControl_TabPage_A01TS(usercontrol_A01TS);

            usercontrol_D02TS = new D02_TS();
            showControl_TabPage_D02TS(usercontrol_D02TS);

            usercontrol_D01bTS = new D01b_TS();
            showControl_TabPage_D01bTS_ITH2(usercontrol_D01bTS);

            usercontrol_D01bTS = new D01b_TS();
            showControl_TabPage_D01bTS_ITH3(usercontrol_D01bTS);

            usercontrol_D01bTS = new D01b_TS();
            showControl_TabPage_D01bTS_ITH4(usercontrol_D01bTS);

            usercontrol_D01bTS = new D01b_TS();
            showControl_TabPage_D01bTS_II(usercontrol_D01bTS);

            usercontrol_D02bTS = new D02b_TS();
            showControl_TabPage_D02bTS(usercontrol_D02bTS);

            usercontrol_BHTT_BHYT = new BBTT_BHYT();
            showControl_TabPage_BBTT_BHYT(usercontrol_BHTT_BHYT);

            usercontrol_D07TS = new D07_TS();
            showControl_TabPage_D07TS(usercontrol_D07TS);

            usercontrol_DinhKem = new Dinh_Kem();
            showControl_TabPage_Dinhkem(usercontrol_DinhKem);

        }
        public void showControl_TabPage_Danhsach(System.Windows.Forms.Control obj)
        {
            panel_DanhSach.Controls.Clear();
            obj.Dock = DockStyle.Fill;
            panel_DanhSach.Controls.Add(obj);
            panel_DanhSach.Controls[obj.Name].Focus();
        }

        public void showControl_TabPage_A01aTS(System.Windows.Forms.Control obj)
        {
            panel_A01aTS.Controls.Clear();
            obj.Dock = DockStyle.Fill;
            panel_A01aTS.Controls.Add(obj);
            panel_A01aTS.Controls[obj.Name].Focus();
        }
        public void showControl_TabPage_A01TS(System.Windows.Forms.Control obj)
        {
            panel_A01TS.Controls.Clear();
            obj.Dock = DockStyle.Fill;
            panel_A01TS.Controls.Add(obj);
            panel_A01TS.Controls[obj.Name].Focus();
        }


        public void showControl_TabPage_D02TS(System.Windows.Forms.Control obj)
        {
            panel_D02TS.Controls.Clear();
            obj.Dock = DockStyle.Fill;
            panel_D02TS.Controls.Add(obj);
            panel_D02TS.Controls[obj.Name].Focus();
        }
        public void showControl_TabPage_D01bTS_ITH2(System.Windows.Forms.Control obj)
        {
            panel_D01bTS_ITH2.Controls.Clear();
            obj.Dock = DockStyle.Fill;
            panel_D01bTS_ITH2.Controls.Add(obj);
            panel_D01bTS_ITH2.Controls[obj.Name].Focus();
        }
        public void showControl_TabPage_D01bTS_ITH3(System.Windows.Forms.Control obj)
        {
            panel_D01bTS_ITH3.Controls.Clear();
            obj.Dock = DockStyle.Fill;
            panel_D01bTS_ITH3.Controls.Add(obj);
            panel_D01bTS_ITH3.Controls[obj.Name].Focus();
        }
        public void showControl_TabPage_D01bTS_ITH4(System.Windows.Forms.Control obj)
        {
            panel_D01bTS_ITH4.Controls.Clear();
            obj.Dock = DockStyle.Fill;
            panel_D01bTS_ITH4.Controls.Add(obj);
            panel_D01bTS_ITH4.Controls[obj.Name].Focus();
        }
        public void showControl_TabPage_D02bTS(System.Windows.Forms.Control obj)
        {
            panel_D02bTS.Controls.Clear();
            obj.Dock = DockStyle.Fill;
            panel_D02bTS.Controls.Add(obj);
            panel_D02bTS.Controls[obj.Name].Focus();
        }
        public void showControl_TabPage_BBTT_BHYT(System.Windows.Forms.Control obj)
        {
            panel_BBTT_BHYT.Controls.Clear();
            obj.Dock = DockStyle.Fill;
            panel_BBTT_BHYT.Controls.Add(obj);
            panel_BBTT_BHYT.Controls[obj.Name].Focus();
        }
        public void showControl_TabPage_D01bTS_II(System.Windows.Forms.Control obj)
        {
            panel_D01bTS_II.Controls.Clear();
            obj.Dock = DockStyle.Fill;
            panel_D01bTS_II.Controls.Add(obj);
            panel_D01bTS_II.Controls[obj.Name].Focus();
        }
        public void showControl_TabPage_D07TS(System.Windows.Forms.Control obj)
        {
            panel_D07TS.Controls.Clear();
            obj.Dock = DockStyle.Fill;
            panel_D07TS.Controls.Add(obj);
            panel_D07TS.Controls[obj.Name].Focus();
        }
        public void showControl_TabPage_Dinhkem(System.Windows.Forms.Control obj)
        {
            panel_DinhKem.Controls.Clear();
            obj.Dock = DockStyle.Fill;
            panel_DinhKem.Controls.Add(obj);
            panel_DinhKem.Controls[obj.Name].Focus();
        }

        private void btnNapDuLieu_Click(object sender, EventArgs e)
        {
            if (ultraTabPage_D07TS.Tab.Active)
            {
                frmNhapDuLieuExcel frmNhapDuLieu = new frmNhapDuLieuExcel();
                frmNhapDuLieu.Show();
            }
        }

    }
}
